package compiler;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import language.LType;

public class LocSupplier{ /*extends Loc implements Sup {

    public LocSupplier(List list, Map<String, LType> constants) {
        super(list, constants);
    }

    LType call(Map<Character, LType> vars) {
        return new Instance(vars).next();
    }

    @Override
    public LType get(Map<Character, LType> vars) {
        return call(vars);
    }

    @Override
    Loc getNew(List l, Map<String, LType> constants) {
        return new LocSupplier(l, constants);
    }

    class Instance extends Loc.Instance {

        public Instance(Map<Character, LType> vars) {
            super(vars);
        }

        @Override
        Object of(String s) {
            if (constants.containsKey(s)) {
                return constants.get(s);
            }
            return null;
        }

        @Override
        Map newVars(Map<Character, LType> map) {
            return map;
        }
    }

    @Override
    public String toString() {
        LType call = call(new HashMap());
        if (call != null) {
            return call.toString();
        }
        return "";
    }
}
*/}